#include <stdio.h>

int main()
{
	freopen("test.in", "r", stdin);
	freopen("test.out", "w", stdout);
	for ( int i = 42; i<=1000; i++ ) {
		if ( i % 42 == 0 ) {
			printf("%d\n", i);
		}
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
